/**
 * 课程模块路由文件
 */

const Router = require('koa-router');
const router = new Router();
const { validAdd, validSearch, validUpdate, validSearchForSelector } = require('../validators/course_list');
const { validate } = require('../validators/common');
const { add, search, update, deleteC, searchForSelector } = require('../services/course_list');

router.prefix('/course');

router.post('/add', validate(validAdd), add);

router.get('/search', validate(validSearch), search);

router.get('/searchSelector', validate(validSearchForSelector), searchForSelector);

router.put('/update', validate(validUpdate), update);

router.delete('/delete/:id', deleteC);

module.exports = router;